package com.base.hong.ui

import android.content.Intent
import android.graphics.Color
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.SeekBar
import android.widget.SeekBar.OnSeekBarChangeListener
import com.base.hong.databinding.ActivityTestBinding
import com.base.hong.utils.AdbClient
import com.htt.base_library.base.BaseActivity
import kotlin.concurrent.thread

class TestActivity : BaseActivity<ActivityTestBinding>() {
    override fun initView(intent: Intent?, savedInstanceState: Bundle?) {
        mViewBinding.btnClean.setOnClickListener {
            connectADB()
        }
        mViewBinding.btnRed.setOnClickListener {

        }
        mViewBinding.btnGreen.setOnClickListener {
        }
        mViewBinding.seekBar.setOnSeekBarChangeListener(object :OnSeekBarChangeListener{
            override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {

            }

            override fun onStartTrackingTouch(seekBar: SeekBar?) {

            }

            override fun onStopTrackingTouch(seekBar: SeekBar?) {

            }

        })
    }


    fun connectADB(){
        thread {
            AdbClient.connectShell(this,"192.168.3.253",6666).run {
                var response=sendCommand("ls")

                Log.e("ADB",response)
                response=sendCommand("getprop ro.build.version.sdk")
                Log.e("ADB",response)
                response=sendCommand("cat system/build.prop")
                Log.e("ADB",response)
            }
        }
    }
}